#include<iostream>
using namespace std;
int main(){
	int n,B,S,G;
	cin>>n;
	B=n/100;
	S=n%100/10;
	G=n%100%10;
	if(n==B*B*B+S*S*S+G*G*G)
	{
		cout<<"YES";
	}else{
		cout<<"NO";
	} 
	return 0;
}


